<template>
  <select :value="value" @change="updateValue" v-bind="$attrs">
    <option v-for="option in options"
            :value="option"
            :key="option"
            :selected="option===value"
    >{{option}}</option>
  </select>
</template>

<script>
export default {
  name: 'BaseSelect',
  props: ['value'],
  setup(props, ctx) {
    const updateValue = e => ctx.emit('update:value', e.target.value)
    return {options: [1,2,3,4], updateValue}
  }
}
</script>
